package com.htjc.integral.account.util.enums;

import java.util.HashMap;
import java.util.Map;

import org.codehaus.jackson.map.ObjectMapper;

import com.sgcc.sip.access.rest.SipRestAccessAgent;
import com.sgcc.sip.access.rest.SipRestAccessAgentFactory;

public class NewAccountConfig {

	private static String account = "usc_channel_test";
	//sip接入密码，sip平台配置管理，
	private static String pwd = "1234abcd";
	//sip加密因子，sip平台配置管理
	private static String secretKey = "0CCBFC8E49EC3C0A0EB9A7AD634BA161";
	//sip获取siptoken服务地址
	public static String url="https://usc.esgmallt.com/sip/authz/gettoken";
	public static String uscBaseUrl = "https://usc.esgmallt.com";
	//生产环境将分配新的用户名，密码，秘钥，
	//private static String url="https://usc.esgcc.com.cn/user/powerquery";
	public static SipRestAccessAgentFactory factory = new SipRestAccessAgentFactory(url, account, pwd, secretKey, "111111");

	public static void main(String[] args) throws Exception {
		ObjectMapper objectMapper = new ObjectMapper();
		SipRestAccessAgent agent = factory.getInstance();
		//登录认证
		Map<String, String> map = new HashMap<String, String>();
		map.put("tenant", "state_grid");
		map.put("member", "esgcc_personal");
		String uscInfo = objectMapper.writeValueAsString(map);
		map.clear();
		map.put("userId", "d292e7b139514c759def688e702b46cd");
		String quInfo = objectMapper.writeValueAsString(map);
		map.clear();
		map.put("uscInfo", uscInfo);
		map.put("quInfo", quInfo);
		map.put("token", "6be421b59a71407fac62b49b4b3cbf69");
		String info = agent.post(uscBaseUrl+"/user/powerquery", map);
		System.out.println("**************" + info);
	}
}
